<?php 
namespace app\index\controller;

use think\Controller;
use think\Db;
use think\Session;
use think\Request;
use app\index\model\member;

class Members extends Controller
{
	public function __construct() {
        parent::__construct();
        $this->member_id = Session::get('member_id');
        if (empty($this->member_id)) {
        	$this->redirect('login/login');
        }
    }

	public function member()
	{
        $member = new member();
		$member_info = $member->getMemberInfo(array('member_id'=>$this->member_id));
		if (empty($member_info)) {
			$this->redirect('login/login');
		}
		if($member_info['head_pic'] == false){	//判断是否有头像，没有选择系统默认头像
			$member_info['head_pic'] = getMemberHeadImg($member_info['head_pic']);
		}
		$this->assign(['member'=>$member_info]);
		return $this->fetch();
	}
}